package com.nhncorp.pleiades.ens;

public interface Constants {

  public static final int READ_TIMEOUT = 600;

  public static final int MAX_LOCK_DELAY = 60 * 1000; // one minute

  public static final int MIN_LOCK_DELAY = 2 * 1000; // two seconds
  
  public static final String SERVICE_DELIMETER = "||";
  
  public static final String LOCK_BASE = "/nebula/pleiades";
  
  public static final String PERSISTENT_LOCK_BASE = "/nebula/pleiades/node";

  public static final String CLUSTER_CHANNEL_NAME = "com.nhncorp.pleiades.clusterChannel";

  public static final String CLUSTER_STORAGE_NAME = "com.nhncorp.pleiades.clusterStorage";
  
  public static final String LOCK_STORE_NAME = "com.nhncorp.pleiades.distributedLockStore";
  
  public static final String MASTER_CHANNEL_NAME = "com.nhncorp.pleiades.masterChannel";
  
  public static final String EVENT_CHANNEL_NAME = "com.nhncorp.pleiades.eventChannel";
  
  public static final String EVENT_ENTRY_STORE_NAME = "com.nhncorp.pleiades.eventEntryStore";
  
  public static final String EVENT_SPACE_NAME = "com.nhncorp.pleiades.eventSpace";
  
  public static final String CLUSTER_ADDRESS = "UDP(mcast_addr=228.8.8.8;mcast_port=45566;ip_ttl=32;"
      + "mcast_send_buf_size=150000;mcast_recv_buf_size=80000):";

  public static final String NOTIFICATION_ADDRESS = "UDP(mcast_addr=228.8.8.10;mcast_port=45566;ip_ttl=32;"
    + "mcast_send_buf_size=150000;mcast_recv_buf_size=80000):";

  public static final String EVENT_ADDRESS = "UDP(mcast_addr=228.8.8.12;mcast_port=45566;ip_ttl=32;"
    + "mcast_send_buf_size=150000;mcast_recv_buf_size=80000):";

  public static final String STORAGE_ADDRESS = "UDP(mcast_addr=228.8.8.14;mcast_port=45566;ip_ttl=32;"
    + "mcast_send_buf_size=150000;mcast_recv_buf_size=80000):";

  public static final String LOCK_ADDRESS = "UDP(mcast_addr=228.8.8.16;mcast_port=45566;ip_ttl=32;"
    + "mcast_send_buf_size=150000;mcast_recv_buf_size=80000):";
  
  
  public static final String TCP_GOSSIP_PROPERTY = "TCP(start_port=7800;bind_addr=localhost;loopback=true):"
    + "TCPGOSSIP(timeout=3000;initial_hosts=localhost[12000];num_initial_members=3):"
    + "MERGE2(min_interval=5000;max_interval=10000):"
    + "FD(timeout=2000;max_tries=4):"
    + "VERIFY_SUSPECT(timeout=1500):"
    + "pbcast.NAKACK(gc_lag=100;retransmit_timeout=600,1200,2400,4800):"
    + "UNICAST(timeout=5000):"
    + "pbcast.STABLE(stability_delay=1000;desired_avg_gossip=20000;max_bytes=0):"
    + "FRAG(frag_size=4096;down_thread=false;up_thread=false):"
    + "pbcast.GMS(join_timeout=5000;join_retry_timeout=2000;shun=true;print_local_addr=false):" 
    + "pbcast.STATE_TRANSFER";
  
  public static final String TUNNEL_PROPERTY = "TUNNEL(router_port=12001;router_host=clustermanager.nhncorp.com):"
    + "PING(timeout=2000;num_initial_members=2;gossip_refresh=10000;" +
    		"gossip_host=clustermanager.nhncorp.com;gossip_port=12001;num_ping_requests=1):"
    + "MERGE2(min_interval=5000;max_interval=20000):"
    + "FD(timeout=2000;max_tries=3;shun=true):"
    + "VERIFY_SUSPECT(timeout=1500):"
    + "pbcast.NAKACK(max_xmit_size=60000;use_mcast_xmit=false;" +
    		"gc_lag=0;retransmit_timeout=300,600,1200,2400,4800;discard_delivered_msgs=true):"
    + "UNICAST(timeout=300,600,1200,2400,3600):"
    + "pbcast.STABLE(stability_delay=1000;desired_avg_gossip=5000;max_bytes=400000):"
    + "FRAG(frag_size=60000;down_thread=false;up_thread=false):"
    + "pbcast.GMS(print_local_addr=true;join_timeout=3000;join_retry_timeout=2000;" +
    		"shun=false;view_bundling=true;view_ack_collection_timeout=5000):" 
    + "FC(max_credits=2000000;min_threshold=0.10):"
    + "pbcast.STATE_TRANSFER:"
    + "pbcast.FLUSH(timeout=0)";

  public static final String SOCK_PROPERTY = "PING(timeout=2000;num_initial_members=3):"
      + "MERGE2(min_interval=5000;max_interval=10000):"
      + "FD_SOCK(down_thread=false;up_thread=false):"
      + "FD(timeout=2000;max_tries=3;shun=true;down_thread=false;up_thread=false):"
      + "VERIFY_SUSPECT(timeout=1500):"
      + "pbcast.NAKACK(gc_lag=50;retransmit_timeout=300,600,1200,2400,4800):"
      + "UNICAST(timeout=5000):"
      + "pbcast.STABLE(desired_avg_gossip=20000):"
      + "FRAG(frag_size=4096;down_thread=false;up_thread=false):"
      + "pbcast.GMS(join_timeout=5000;join_retry_timeout=2000;shun=false;print_local_addr=false):" + "pbcast.STATE_TRANSFER";

  public static final String NONSOCK_PROPERTY = "PING(timeout=2000;num_initial_members=3):"
      + "MERGE2(min_interval=5000;max_interval=10000):"
      + "FD(timeout=2000;max_tries=3;shun=true):"
      + "VERIFY_SUSPECT(timeout=1500):"
      + "pbcast.NAKACK(gc_lag=50;retransmit_timeout=300,600,1200,2400,4800):"
      + "UNICAST(timeout=5000):"
      + "pbcast.STABLE(desired_avg_gossip=20000):"
      + "FRAG(frag_size=4096;down_thread=false;up_thread=false):"
      + "pbcast.GMS(join_timeout=5000;join_retry_timeout=2000;shun=false;print_local_addr=false):" + "pbcast.STATE_TRANSFER";
  
  public static final String default_property = "UDP(oob_thread_pool.max_threads=8;oob_thread_pool.keep_alive_time=5000;" 
      + "max_bundle_size=64000;mcast_send_buf_size=640000;oob_thread_pool.queue_max_size=100;" 
      + "mcast_recv_buf_size=25000000;use_concurrent_stack=true;tos=8;mcast_port=45588;" 
      + "loopback=false;thread_pool.min_threads=2;oob_thread_pool.rejection_policy=Run;" 
      + "thread_pool.max_threads=8;enable_diagnostics=true;thread_naming_pattern=cl;" 
      + "ucast_send_buf_size=640000;ucast_recv_buf_size=20000000;thread_pool.enabled=true;" 
      + "use_incoming_packet_handler=true;oob_thread_pool.enabled=true;ip_ttl=2;enable_bundling=true;" 
      + "thread_pool.rejection_policy=Run;discard_incompatible_packets=true;thread_pool.keep_alive_time=5000;" 
      + "thread_pool.queue_enabled=true;mcast_addr=228.10.10.10;max_bundle_timeout=30;oob_thread_pool.queue_enabled=false;" 
      + "oob_thread_pool.min_threads=1;thread_pool.queue_max_size=1000):PING(num_initial_members=3;timeout=2000):" 
      + "MERGE2(min_interval=10000;max_interval=30000):FD_SOCK:FD(max_tries=5;timeout=10000;shun=true):VERIFY_SUSPECT(timeout=1500):" 
      + "BARRIER:pbcast.NAKACK(use_stats_for_retransmission=false;gc_lag=0;use_mcast_xmit=true;retransmit_timeout=50,300,600,1200;" 
      + "exponential_backoff=150;discard_delivered_msgs=true):UNICAST(timeout=300,600,1200):pbcast.STABLE(desired_avg_gossip=50000;" 
      + "max_bytes=1000000;stability_delay=1000):VIEW_SYNC(avg_send_interval=60000):pbcast.GMS(print_local_addr=false;view_bundling=true;" 
      + "join_timeout=3000;shun=false):FC(max_credits=500000;min_threshold=0.20):FRAG2(frag_size=60000):pbcast.STATE_TRANSFER";
  
}
